-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make cross-contract callee non-optional #1636
Make cross-contract callee non-optional #1636
Conversation
crates/env/src/call/call_builder.rs
Outdated
call_flags: self.call_flags, | ||
exec_input: self.exec_input, | ||
return_type: self.return_type, | ||
_phantom: Default::default(), | ||
} | ||
} | ||
|
||
/// Sets the `code_hash` for the current cross-contract delegate call. | ||
pub fn code_hash( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So @ascjones I guess what you're suggesting is we rename this to delegate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly, so by calling one method or the other we instantiate the builder type for the type of call we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually maybe the choices are
callee
&code_hash
call
&delegate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but then we should rename the callee
builder method to call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧠 🤝 🧠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More like 🥜 🤝 🥜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deez nuts
Not going to wait for examples test to run, tests run locally okay and it is hanging occasionally. |
* Remove `Default` bound on `AccountId` type * Manually implement storage traits for AccountID Since it doesn't implement `Default` we can't use the macro implementations anymore. * Update `Call` builder to not use default AccountId * Use non-Default bound functions when reading AccountIds * Remove unused `get_property_inplace` method * Update `CallParams` to use `None` when no account ID is set * Update examples to explicitly use zero address * Remove unused environment function * Manually implement `Default` in DNS example * Fix spellcheck * Correctly encode the `callee` account ID when calling `pallet-contracts` * Update `CHANGELOG` * Make cross-contract callee non-optional (#1636) * Make cross-contract callee non-optional * clippy * Fmt * Fix * clippy * clippy * clippy * Add a similar method for `code_hash` * Fix doc tests * RustFmt * Rename top level methods to `call` and `delegate` * Fix some renames --------- Co-authored-by: Hernando Castano <hernando@hcastano.com> --------- Co-authored-by: Andrew Jones <ascjones@gmail.com>
Suggestion for how to enforce
callee
in #1255.This breaks the
CallBuilder
API by introducing two new methods:call
anddelegate
, which canbe used to streamline the
CallBuilder
set-up for the respective call types.